{% extends 'bootstrap/base.html' %}

{% block styles %}
    {{ super() }}
    <link rel="stylesheet" href="{{ url_for('static',filename='Message_Broad.css') }}">
{% endblock %}

{% block scripts %}
    {{ super() }}
    <script src="{{ url_for('static',filename='/script/basemodel.js') }}"></script>

    <div class="container">
        <div class="row">
            <div class="col text-center">
                Copyright © 2020-2021 <strong><a href="//dashiandjie.top/" target="_blank">message board</a></strong>&nbsp;
                <strong><a href="http://dashiandjie.top/" target="_blank">messaege board</a></strong> All Rights
                Reserved.
                备案号：<a target="_blank" rel="nofollow" href="https://beian.miit.gov.cn/">桂ICP备20006284号-1</a>
            </div>
        </div>
    </div>
{% endblock %}

{% block title %}Home Page{% endblock %}

{% block navbar %}
    <!--head-->
    <div class="container">
        <div class="row">
            <div class="col">
                <div class="head-logo" style="background-image: url(../photo/QQ图片20201027160436.jpg)">
                    <h1>
                        <a class="text-dark" href="#">
                            Message Broad
                        </a>
                    </h1>
                    <p>Note your life!</p>
                </div>
            </div>
        </div>
    </div>

    <!--menu-->
    <div class="container bg-dark">
        <div class="row">
            <div class="col">
                <nav class="navbar navbar-expand-lg navbar-ligh">
                    <ul class="navbar-nav nav-pills mr-auto">
                        <li class="nav-item">
                            <a class="nav-link font-weight-normal active" href="/">
                                Home Page
                            </a>
                        </li>
                        <li class="nav-item">
                            <form class="form-inline">
                                <input id='search_form' class="form-control mr-sm-2" type="search" placeholder="Search"
                                       aria-label="Search">
                                <button id='search' class="btn btn-outline-info my-2 my-sm-0" type="button">Search
                                </button>
                            </form>
                        </li>
                    </ul>

                    {% if current_user.is_authenticated %}
                        <ul class="navbar-nav">
                            <li class="nav-item">
                                <a class="nav-link font-weight-normal"
                                   href="{{ url_for('passagesview.create_passage') }}">
                                    Star a new writing here!
                                </a>
                            </li>
                            <li class="nav-item">
                                <a class="nav-link font-weight-normal"
                                   href="{{ url_for('userview.user', username=current_user.user_name) }}">
                                    Hi! {{ current_user.user_name }}
                                </a>
                            </li>
                            <li class="nav-item">
                                <a class="nav-link font-weight-normal"
                                   href="{{ url_for('passagesview.my_post', username=current_user.user_id) }}">
                                    My Post
                                </a>
                            </li>
                            <li class="nav-item">
                                <a class="nav-link font-weight-normal" href="{{ url_for('loginview.logout') }}">
                                    注销
                                </a>
                            </li>
                        </ul>
                    {% else %}
                        <ul class="navbar-nav">
                            <li class="nav-item">
                                <a class="nav-link font-weight-normal" href="{{ url_for('loginview.login') }}">
                                    登录
                                </a>
                            </li>

                            <li class="nav-item">
                                <a class="nav-link font-weight-normal" href="{{ url_for('loginview.register') }}">
                                    注册
                                </a>
                            </li>
                        </ul>
                    {% endif %}
                </nav>
            </div>
        </div>
    </div>
{% endblock %}

{% block messages %}
    <div class="container">
        <!-- show messages -->
        {% for i in get_flashed_messages() %}
            <div class="row">
                <div class="col">
                    <div class="alert alert-primary alert-dismissible fade show" role="alert">
                        {{ i }}
                        <button type="button" class="close" data-dismiss="alert" aria-label="Close">
                            <span aria-hidden="true">&times;</span>
                        </button>
                    </div>
                </div>
            </div>
        {% endfor %}
    </div>
{% endblock %}

{% block content %}

{% endblock %}
